package com.qiangqiang.repository;

import com.qiangqiang.entity.Ban;
import org.springframework.data.domain.Page;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.query.Procedure;
import org.springframework.data.repository.query.Param;

import java.util.List;

/**
 * Created by q on 2018/2/1.
 */
public interface BanRepository extends JpaRepository<Ban,Integer>{

    @Procedure(name = "insert_ban")
    void insertBan(@Param("scoreId") String scoreId, @Param("dId") String dId, @Param("goods") String goods);

    //分页查询所有违规的物品


    /**
     * 根据id查询
     * @param bId
     * @return
     */
    Ban queryByBId(int bId);

    /**
     * 根据宿舍号查询
     * @param dId
     * @return
     */
    List<Ban> queryAllByDId(String dId);
}
